package top.cyuw.subjectsystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import top.cyuw.subjectsystem.util.ListIntegerToVarcharTypeHandler;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@TableName(value = "subject", autoResultMap = true)
public class Subject extends Model<Subject> implements Serializable {

    /**
     * 课题ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 题目
     */
    private String name;

    /**
     * 题目描述
     */
    private String description;

    /**
     * 部门限制
     */
    @TableField(value = "limits", typeHandler = ListIntegerToVarcharTypeHandler.class)
    private List<Integer> limits;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

}
